package yao.config;

import java.util.LinkedHashMap;
import java.util.Map;

public class ValueMap extends LinkedHashMap<String, Value> {

	private static final long serialVersionUID = 6670479270939872995L;

	Value put$(String key, Value value) {
		super.put(key, value);
		return value;
	}

	void putAll$(Map<? extends String, ? extends Value> m) {
		super.putAll(m);
	}

	public Value put(String key, Value value) {
		if (!keySet().contains(key)) {
			throw new UnsupportedOperationException("Can not add new entry[key: " + key + "] in ValueMap");
		}
		super.put(key, value);
		return value;
	}

	public void putAll(Map<? extends String, ? extends Value> m) {
		for (String key : m.keySet()) {
			if (!keySet().contains(key)) {
				throw new UnsupportedOperationException("Can not add new entry[key: " + key + "] in ValueMap");
			}
		}
		super.putAll(m);
	}

	public void clear() {
		throw new UnsupportedOperationException();
	}

	public Value remove(Object key) {
		throw new UnsupportedOperationException();
	}

	class ValueMapEntry {
		
	}

}
